function ajaxFun(url){
    var flag = false;
    $.ajax({
        type: "POST",                            
        url: url,                                      
        dataType:"json", 
        async:false,
        success: function(data){
            if(data.status =="fail"){
                show_err_msg(data.msg);  
                return;  
            }else{
                flag = data.flag;
            }
        },
        error:function(data){
            show_err_msg("服务链接出错！"); 
            return;   
        }
    });
    return flag;
}
function uploadFile(actionUrl,elementId,redirectUrl){
    $.ajaxFileUpload
        ({
            url:actionUrl,
            type: 'POST',
            secureuri:false,
            fileElementId:elementId,
            dataType: 'json',
            data:{fileType:elementId},
            success: function (data, status)
            {
                if(data.status == "fail"){
                    show_err_msg(data.info);
                }else if(data.status == "succeed"){
                    show_msg(data.info,redirectUrl);
                }
            },
            error: function (data, status, e)
            {
                alert(e);
            }
        })
}
function uploadImage(urlImage,elementId,fileName,obj,init){
    $.ajaxFileUpload
        ({
            url:urlImage,
            type: 'POST',
            secureuri:false,
            fileElementId:elementId,
            dataType: 'json',
            data:{filePath:fileName,imageType:elementId},
            success: function (data)
            {
                if(data.status == "fail"){
                    show_err_msg(data.info);
                    obj.val('');
                    init();
                }else if(data.status == "succeed"){
                    show_msg(data.info,'');
                    obj.val(data.path);
                    init();
                }
            },
            error: function (data,e)
            {
                alert(e);   
                obj.val('');
            }
        })
}
function checkEndTime(startTime,endTime){   
    var start=new Date(startTime.replace("-", "/").replace("-", "/"));
    var end=new Date(endTime.replace("-", "/").replace("-", "/"));  
    if(end<start){  
        return false;  
    }  
    return true;  
} 